package com.weixing.mall.provider.controller.front;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.weixing.mall.base.wrapper.Result;
import com.weixing.mall.base.wrapper.ResultUtil;
import com.weixing.mall.core.support.BaseController;
import com.weixing.mall.core.support.auth.AuthUtil;
import com.weixing.mall.core.support.auth.MemAuth;
import com.weixing.mall.provider.model.vo.MemberPointVo;
import com.weixing.mall.provider.service.IMemberPointService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 会员积分模块
 *
 * @author siashan
 * @since 1.0
 */
@RestController
@RequestMapping(value = "/front/memberPoint")
public class FrontMemberPointController extends BaseController {
    @Autowired
    private IMemberPointService memberPointService;

    /**
     * 积分记录
     *
     * @return 记录
     */
    @GetMapping(value = "selectPointList")
    public Result<IPage<MemberPointVo>> selectMemberPointList(){
        MemAuth memAuth = AuthUtil.getMemberExt();
        return ResultUtil.success(memberPointService.selectOfPage(initMpPage(),memAuth.getMid()));
    }
}
